Optimal. Leaf size=121 \[ -\frac {2 \left (a^2 A-A b^2-2 a b B\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{d}+\frac {2 \left (6 a A b+3 a^2 B+b^2 B\right ) F\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{3 d}+\frac {2 a^2 A \sin (c+d x)}{d \sqrt {\cos (c+d x)}}+\frac {2 b^2 B \sqrt {\cos (c+d x)} \sin (c+d x)}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.16, antiderivative size = 121, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.152, Rules used = {3067, 3102,
2827, 2720, 2719} \begin {gather*} \frac {2 \left (3 a^2 B+6 a A b+b^2 B\right ) F\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{3 d}-\frac {2 \left (a^2 A-2 a b B-A b^2\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{d}+\frac {2 a^2 A \sin (c+d x)}{d \sqrt {\cos (c+d x)}}+\frac {2 b^2 B \sin (c+d x) \sqrt {\cos (c+d x)}}{3 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2719
Rule 2720
Rule 2827
Rule 3067
Rule 3102
Rubi steps
\begin {align*} \int \frac {(a+b \cos (c+d x))^2 (A+B \cos (c+d x))}{\cos ^{\frac {3}{2}}(c+d x)} \, dx &=\frac {2 a^2 A \sin (c+d x)}{d \sqrt {\cos (c+d x)}}-2 \int \frac {-\frac {1}{2} a (2 A b+a B)+\frac {1}{2} \left (a^2 A-A b^2-2 a b B\right ) \cos (c+d x)-\frac {1}{2} b^2 B \cos ^2(c+d x)}{\sqrt {\cos (c+d x)}} \, dx\\ &=\frac {2 a^2 A \sin (c+d x)}{d \sqrt {\cos (c+d x)}}+\frac {2 b^2 B \sqrt {\cos (c+d x)} \sin (c+d x)}{3 d}-\frac {4}{3} \int \frac {\frac {1}{4} \left (-b^2 B-3 a (2 A b+a B)\right )+\frac {3}{4} \left (a^2 A-A b^2-2 a b B\right ) \cos (c+d x)}{\sqrt {\cos (c+d x)}} \, dx\\ &=\frac {2 a^2 A \sin (c+d x)}{d \sqrt {\cos (c+d x)}}+\frac {2 b^2 B \sqrt {\cos (c+d x)} \sin (c+d x)}{3 d}-\left (a^2 A-A b^2-2 a b B\right ) \int \sqrt {\cos (c+d x)} \, dx-\frac {1}{3} \left (-6 a A b-3 a^2 B-b^2 B\right ) \int \frac {1}{\sqrt {\cos (c+d x)}} \, dx\\ &=-\frac {2 \left (a^2 A-A b^2-2 a b B\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{d}+\frac {2 \left (6 a A b+3 a^2 B+b^2 B\right ) F\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{3 d}+\frac {2 a^2 A \sin (c+d x)}{d \sqrt {\cos (c+d x)}}+\frac {2 b^2 B \sqrt {\cos (c+d x)} \sin (c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.67, size = 102, normalized size = 0.84 \begin {gather*} \frac {2 \left (\left (-3 a^2 A+3 A b^2+6 a b B\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )+\left (6 a A b+3 a^2 B+b^2 B\right ) F\left (\left .\frac {1}{2} (c+d x)\right |2\right )+\frac {\left (3 a^2 A+b^2 B \cos (c+d x)\right ) \sin (c+d x)}{\sqrt {\cos (c+d x)}}\right )}{3 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(404\) vs.
\(2(165)=330\).
time = 0.35, size = 405, normalized size = 3.35
method | result | size |
default | \(\frac {-\frac {8 B \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b^{2}}{3}+4 A \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a^{2}-4 A a b \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \EllipticF \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )-2 A \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) a^{2}+2 A \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) b^{2}+\frac {4 B \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b^{2}}{3}-2 B \,a^{2} \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \EllipticF \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )-\frac {2 B \,b^{2} \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \EllipticF \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )}{3}+4 B \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) a b}{\sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, d}\) | \(405\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [C] Result contains higher order function than in optimal. Order 9 vs. order
4.
time = 0.12, size = 240, normalized size = 1.98 \begin {gather*} \frac {\sqrt {2} {\left (-3 i \, B a^{2} - 6 i \, A a b - i \, B b^{2}\right )} \cos \left (d x + c\right ) {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right ) + \sqrt {2} {\left (3 i \, B a^{2} + 6 i \, A a b + i \, B b^{2}\right )} \cos \left (d x + c\right ) {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right ) - 3 \, \sqrt {2} {\left (i \, A a^{2} - 2 i \, B a b - i \, A b^{2}\right )} \cos \left (d x + c\right ) {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right )\right ) - 3 \, \sqrt {2} {\left (-i \, A a^{2} + 2 i \, B a b + i \, A b^{2}\right )} \cos \left (d x + c\right ) {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right )\right ) + 2 \, {\left (B b^{2} \cos \left (d x + c\right ) + 3 \, A a^{2}\right )} \sqrt {\cos \left (d x + c\right )} \sin \left (d x + c\right )}{3 \, d \cos \left (d x + c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: SystemError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.57, size = 158, normalized size = 1.31 \begin {gather*} \frac {B\,b^2\,\left (\frac {2\,\sqrt {\cos \left (c+d\,x\right )}\,\sin \left (c+d\,x\right )}{3}+\frac {2\,\mathrm {F}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )}{3}\right )}{d}+\frac {2\,A\,b^2\,\mathrm {E}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )}{d}+\frac {2\,B\,a^2\,\mathrm {F}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )}{d}+\frac {4\,A\,a\,b\,\mathrm {F}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )}{d}+\frac {4\,B\,a\,b\,\mathrm {E}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )}{d}+\frac {2\,A\,a^2\,\sin \left (c+d\,x\right )\,{{}}_2{\mathrm {F}}_1\left (-\frac {1}{4},\frac {1}{2};\ \frac {3}{4};\ {\cos \left (c+d\,x\right )}^2\right )}{d\,\sqrt {\cos \left (c+d\,x\right )}\,\sqrt {{\sin \left (c+d\,x\right )}^2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________